﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Messaging.Extensions
{
    public static class ConfigurationExtensions
    {
        public static T ParseOrSetDefault<T>(this string str, T val)
        {
            try
            {
                val = (T)Convert.ChangeType(str, val.GetType());
            }
            catch (Exception ex)
            {
                //TODO : write to log
            }
            return val;
        }
    }
}
